<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">


<p:dialog id="dialogCadastro" modal="false" width="60%" 
	widgetVar="dialogCadastroRaca" header="Cadastro de Raça">
	<h:form id="frmDialogRaca">

		<h:panelGrid columns="2">

			<p:outputLabel value="Codigo"></p:outputLabel>
			<p:inputText value="#{racaMB.racaSelecionada.codigo}"
				disabled="true"></p:inputText>

			<p:outputLabel value="Descrição"></p:outputLabel>
			<p:inputText id="iptnome" onfocus="iptnome"
				value="#{racaMB.racaSelecionada.descricao}" size="30"
				disabled="#{racaMB.consultando}" required="true"
				requiredMessage="Descrição é obrigatória!" maxlength="40"></p:inputText>

			<p:outputLabel value="Porte"></p:outputLabel>
			<p:selectOneMenu value="#{racaMB.racaSelecionada.porte}" required="true" id="selectporte" disabled="#{racaMB.consultando}">
						<f:selectItems value="#{racaMB.listaPorte}" var="port"
								itemLabel="#{port.descricao}" itemValue="#{port.id}"></f:selectItems>
			</p:selectOneMenu>
			

		</h:panelGrid>
		<h:panelGrid columns="2" style="border:0px">
			<p:commandButton value="Confirma" actionListener="#{racaMB.salvar}"
				rendered="#{not racaMB.consultando}" update=":frmTab:tabela"
				oncomplete="dialogCadastroRaca.hide()" />


			<p:commandButton value="Cancela" 
				onclick="dialogCadastroRaca.hide()" />

		</h:panelGrid>

	</h:form>
</p:dialog>

</html>